//
//  KnowledgeController.m
//  CookGuest
//
//  Created by dllo on 15/9/11.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "KnowledgeController.h"
#import "DEFINE.h"
#import "KnowledgeView.h"
#import "JXView.h"
#import "JKView.h"
#import "PRView.h"
#import "MSView.h"
#import "ZTView.h"
#import "AFN.h"
#import "KnowledgeModel.h"
#import "Knowledge_SecViewController.h"


@interface KnowledgeController ()<JXViewDelegate,JKViewDelegate,PRViewDelegate,MSViewDelegate,ZTViewDelegate>  //协议....4


@property (nonatomic, retain) KnowledgeView *knowledgeView;
@property (nonatomic, retain) JXView *jxView;
@property (nonatomic, retain) JKView *jkView;
@property (nonatomic, retain) PRView *prView;
@property (nonatomic, retain) MSView *msView;
@property (nonatomic, retain) ZTView *ztView;


@end

@implementation KnowledgeController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"美食常识";
    self.knowledgeView = [[KnowledgeView alloc]initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT)];
    
    //    self.knowledgeView.scrollView.contentSize = CGSizeMake(WIDTH * 5, 0);
    
    
    [self.view addSubview:self.knowledgeView];
    [self addViews];
    
    
}

#pragma mark- 把五个view 根据偏移量  加到scrollview上
-(void)addViews
{
    self.jxView = [[JXView alloc]init];
    [self.jxView setFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.view.frame.size.height - 64 - 49)];
    [self.knowledgeView.scrollView addSubview:self.jxView];
    
    //    协议....5
    [self.jxView setDelegate:self];
    
    
    
    self.jkView = [[JKView alloc]init];
    [self.jkView setFrame:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    [self.knowledgeView.scrollView addSubview:self.jkView];
    self.jkView.delegate = self;
    
    
    self.prView = [[PRView alloc]init];
    [self.prView setFrame:CGRectMake(SCREEN_WIDTH * 2, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    self.prView.delegate = self;
    [self.knowledgeView.scrollView addSubview:self.prView];
    
    
    self.msView = [[MSView alloc]init];
    [self.msView setFrame:CGRectMake(SCREEN_WIDTH * 3, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    self.msView.delegate = self;
    [self.knowledgeView.scrollView addSubview:self.msView];
    
    
    self.ztView = [[ZTView alloc]init];
    [self.ztView setFrame:CGRectMake(SCREEN_WIDTH * 4, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    self.ztView.delegate = self;
    [self.knowledgeView.scrollView addSubview:self.ztView];
    
}


//协议.....6
-(void)pushViewController:(Knowledge_SecViewController *)viewController
{
    [self.navigationController pushViewController:viewController animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
